package com.langchain4j.simple.service;

import dev.langchain4j.model.output.structured.Description;
import dev.langchain4j.service.UserMessage;
import lombok.Data;

import java.time.LocalDate;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName PersonExtractor
 * @createTime 14:17:00 2025/04/21
 */
public interface PersonExtractor {

    @UserMessage("Extract information about a person from {{it}}")
    Person extractPerson(String text);

    @Data
    class Person {
        // 增加字段描述，让大模型更理解字段含义
        @Description("name of a person")
        private String name;

        private LocalDate birthDate;
    }
}
